<?php

/**
 * PaymentBank form base class.
 *
 * @package    form
 * @subpackage payment_bank
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BasePaymentBankForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'payment_id'       => new sfWidgetFormDoctrineChoice(array('model' => 'Payment', 'add_empty' => true)),
      'bank_id'          => new sfWidgetFormDoctrineChoice(array('model' => 'Bank', 'add_empty' => false)),
      'checking_account' => new sfWidgetFormInput(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorDoctrineChoice(array('model' => 'PaymentBank', 'column' => 'id', 'required' => false)),
      'payment_id'       => new sfValidatorDoctrineChoice(array('model' => 'Payment', 'required' => false)),
      'bank_id'          => new sfValidatorDoctrineChoice(array('model' => 'Bank')),
      'checking_account' => new sfValidatorString(array('max_length' => 50)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('payment_bank[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PaymentBank';
  }

}
